#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QLabel>
#include <QComboBox>
#include <QLineEdit>

#include <QPushButton>

#include <QtNetwork/QTcpSocket>
namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();
    
private:
    Ui::Dialog *ui;

private slots:
    void onSelectServerIP(int iIndex);      //
    void onSetGameName(QString qstrPlayerName);
    void onJoinGame();
    void onSetGamePath();
    void onChangeGamePath();
    //
    void onStartWrite();
    void onGetServerMsg();
    void onServerError(QAbstractSocket::SocketError);


private:
    QLabel *m_pServerLabel;
    QComboBox *m_pServerCmb;
    QLabel *m_pPlayerLabel;
    QLineEdit *m_pPlayerEdit;

    QPushButton *m_pJoinGameButton;
    QLabel *m_pGameDirLabel;
    QLineEdit *m_pGameDirEdit;
    QPushButton *m_pGameDirButton;

    QPushButton *m_pQuickButton;

    //
    QLabel *m_pInfoLabel; // 游戏当前人数，玩家列表

    // 变量
    QString m_qstrPlayerName;
    QString m_qstrGamePath;

    QStringList m_qstrGameServerList;
    QStringList m_qstrArguments;
    QString m_qstrServerIP;

    QTcpSocket* m_pTcpSocket;
};

#endif // DIALOG_H
